home *** CD-ROM | disk | FTP | other *** search
/ Acorn Risc Technologies StrongARM CD-ROM / Acorn Risc Technologies StrongARM CD-ROM.iso / ftp / documents / appnotes / 016_030 / 030c / Text
Encoding:
Text File  |  1993-08-02  |  17.7 KB  |  439 lines

  1. 10th July 1992
  2. -----------------------------------------------------------------------------
  3. Support Group Application Note 
  4. Number: 030
  5. Issue: 1 
  6. Author:
  7. -----------------------------------------------------------------------------
  8.  
  9. BBC B+ 128K - Additional User Information
  10.  
  11. -----------------------------------------------------------------------------
  12. Applicable Hardware: BBC B+
  13.  
  14. Related Application Notes:Information on the B+ 128K
  15.  
  16.  
  17. -----------------------------------------------------------------------------
  18. Copyright (C) Acorn Computers Limited 1992
  19.  
  20. Every effort has been made to ensure that the information in this leaflet is 
  21. true and correct at the time of printing. However, the products described in
  22. this leaflet are subject to continuous development and improvements and
  23. Acorn Computers Limited reserves the right to change its specifications at
  24. any time. Acorn Computers Limited cannot accept liability for any loss or
  25. damage arising from the use of any information or particulars in this
  26. leaflet. ACORN, ECONET and ARCHIMEDES are trademarks of Acorn Computers
  27. Limited.
  28. -----------------------------------------------------------------------------
  29. Support Group
  30. Acorn Computers Limited
  31. Acorn House
  32. Vision Park
  33. Histon
  34. Cambridge       CB4 4AE
  35. -----------------------------------------------------------------------------
  36.  
  37. The following instructions are intended to assist you in making the best use
  38. of the 64K bytes of sideways RAM installed in your computer.  They are
  39. intended to be used in conjunction with both the BBC Micro User Guide and
  40. the Acorn Disc Filing System User Guide.
  41.  
  42.  
  43. Introduction
  44.  
  45. Generally, there are two ways in which to use the 64k bytes of sideways RAM
  46. provided with the computer.  Firstly, the RAM may be viewed as four 16k byte
  47. paged blocks into which suitable ROM images may be loaded.  The second way
  48. is to view the 64k bytes of sideways RAM as one contiguous block of memory
  49. for use as BASIC program space.  These two uses form the basis of the two
  50. different methods of addressing the RAM.
  51.  
  52. For those whose only intention is to use the sideways RAM in one of the two
  53. ways mentioned above, the section that follows is intended as a quick guide
  54. to its use.  For the more adventurous, there then follows a more in-depth
  55. explanation of the means by which the sideways RAM may be utilised.
  56.  
  57.  
  58. GETTING STARTED
  59.  
  60. Having set up the computer in the way described in the User Guide you should
  61. proceed as follows:
  62.  
  63. Loading a ROM image
  64.         To load a suitable ROM image from the currently selected filing
  65. system into the computer you should enter:
  66.  
  67. *SRLOAD <FILENAME> 8000 W Q                      then press the RETURN key.
  68.  
  69. This will cause the ROM image, specified in the filename parameter, to be
  70. loaded into sideways RAM in the first 16k block of memory.
  71.  
  72. Repeating the above command with difference filenames, and incrementing W
  73. through X, Y and Z, will allow you to fill the three other blocks of
  74. sideways RAM with ROM images.
  75.  
  76. Having loaded the image(s) into sideways RAM you must press the BREAK key. 
  77. This caused the newly loaded ROM image(s) to be initialised and they may
  78. then be accessed in the same way as a sideways ROM.
  79.  
  80.  
  81. Using the sideways RAM for BASIC programs
  82. The 64k Sideways RAM Support Disc should be inserted into the disc drive
  83. attached to your machine.  You should then enter the following:
  84.  
  85.         *BAS128                 then press the RETURN key.
  86.  
  87. This will load a disc-based version of BBC BASIC into your machine which
  88. will in turn allow you to make use of the 64k of sideways RAM as BASIC
  89. program space.  For details of BAS128 see below.
  90.  
  91.  
  92. DETAILED DESCRIPTION
  93.  
  94. If the sideways RAM is not being used in conjunction with BAS128 the user
  95. has two different methods of addressing the sideways RAM.  These are
  96. referred to as the ABSOLUTE method and the PSEUDO method.  The absolute
  97. method treats the sideways RAM as four separate pages, referring to them
  98. with ROM IDs, the pseudo method treats the sideways RAM as one contiguous
  99. block addressed in the normal way.
  100.  
  101.  
  102.  
  103. Absolute Addressing
  104.         This form of addressing sees the computer's memory map in the normal
  105. way with the 64k of sideways RAM being split between four 16k pageable
  106. blocks.  These four paged blocks of RAM may be paged in at &8000-&BFFF in
  107. the same way as the paged ROMs.
  108.  
  109. The four pages of sideways RAM are identified as pages W, X, Y, and Z, which
  110. correspond directly to ROM pages C, D, 0 and 1 (see note 1).  As such, they
  111. may be used for storing ROM images loaded in from disc or network filing
  112. systems.
  113.  
  114. To read from or write to these pages of memory, when in the absolute
  115. addressing mode, a ROM ID parameter must be specified when issuing the
  116. appropriate command.
  117.  
  118. This means of addressing is mainly for manipulating data that conforms to
  119. the same format as a paged ROM.  Also the size of the code cannot exceed 16k
  120. in length.  Where the area of memory required exceeds 16k, the absolute
  121. addressing method is inappropriate and the pseudo addressing method should
  122. be employed.
  123.  
  124.  
  125. Pseudo Addressing
  126.         With this form of addressing, the four 16k blocks of sideways RAM
  127. are regarded as one contiguous 64k block (see note 2).
  128.  
  129. The blocks are configured in the manner shown in figure 1.  As you can see
  130. each of the 16k pages have a range of address allocated to them, and it is
  131. these hexadecimal addresses that specify the area of sideways RAM to be used
  132. and not the ROM ID.
  133.  
  134. To use these pages for data it is necessary to first specify that this is
  135. the use to which they are to be put.  This is carried out using the *SRDATA
  136. command (see below).  Therefore, to use the range of addresses &00 through
  137. to &3FEF a *SRDATA W command must be issued.  To use the entire 64k block,
  138. the *SRDATA command must be issued for W, X, Y and Z in turn.
  139.  
  140. It should be noted that, subject to their allocation using the *SRDATA and
  141. *SRROM commands, each block may be specified for use with either ROM images
  142. or DATA irrespective of the use allocated to the other blocks.
  143.  
  144.  
  145. Note 1: At the point of manufacture the ROM numbers allocated to BASIC are E
  146. and F thereby giving it the highest priority.  It is possible to change this
  147. by altering the position of the hardware link S13 located on the main PCB. 
  148. If this priority change is performed, the sideways RAM will occupy pages C,
  149. D, E and F, with BASIC occupying pages 0 and 1.  This will also mean that
  150. ROM IDs Y and Z will correspond to ROM IDs E and F respectively.
  151.  
  152. Note 2: When used as a contiguous block, the sideways RAM will provide
  153. 65.472kbytes of RAM and not a full 64kbyte block.  This is due to 64 bytes
  154. of RAM being allocated for use with the ROM header information.
  155.  
  156.  
  157. (Figure 1)
  158.  
  159.  
  160. Sideways RAM Utilities
  161.  
  162. In view of its nature, sideways RAM can prove difficult to use.  To help
  163. you, there are six utilities which are resident in the 1770 disc filing
  164. system ROM already present in your machine.  These utilities are as follows:
  165.  
  166. UTILITY         PARAMETERS
  167.  
  168. *SRSAVE         <FILENAME> <START ADDRESS> <END ADDRESS> (<ROM ID>) (Q)
  169. *SRLOAD         <FILENAME> <LOAD ADDRESS> (<ROM ID>) (Q)
  170. *SRWRITE        <START ADDRESS> <END ADDRESS> <START ADDRESS> (ROM ID)
  171. *SRREAD         <START ADDRESS> <END ADDRESS> <START ADDRESS> (ROM ID)
  172. *SRROM          <ROM ID>
  173. *SRDATA         <ROM ID>
  174.  
  175. The parameters used with these utilities, with two exceptions, should in
  176. general be familiar to you.  The two new parameters, ROM ID and Q, are
  177. explained below, with explanations of the utilities following thereafter.
  178.  
  179. It should be noted that the END parameter requires the address of the byte
  180. immediately after the last byte of the block of memory involved.  In other
  181. words, for <END ADDRESS> read <LAST ADDRESS+1>.
  182.  
  183.  
  184. The ROM ID parameter
  185.         The ROM ID parameter allows a particular page to be specified for
  186. use.  There are two different ways in which this may be done:
  187.  
  188. ROM ID in the range &0 to &F
  189.         This is the basis of the absolute addressing mode.  the pages of
  190. memory specified in this range correspond directly to the sideways memory
  191. pages recognised by the computer's operating system.
  192.  
  193. Note that although any ROM ID in the range &0 to &F may be entered, only C,
  194. D, 0 and 1 (see note 1) are pertinent when considering this particular
  195. application.  Use of any parameter, other than those referring to sideways
  196. RAM pages, is precluded during all read operations because of the need to
  197. protect ROM based software.
  198.  
  199. ROM ID in the range W to Z
  200.         The ROM IDs W, X, Y and Z correspond directly to ROM IDs C, D, 0 and
  201. 1.  They are provided as a 'non-machine-specific' way of specifying four
  202. memory pages.  As with ROM IDs &0 to &F, the use of these ROM IDs is part of
  203. the absolute method of addressing.
  204.  
  205. ROM ID left unspecified
  206.         Not specifying a ROM ID constitutes use of the pseudo addressing
  207. method.  The operation will be performed with regard to the specified
  208. address(es) only.
  209.  
  210.  
  211. The Q parameter
  212.         The Q (Quickly) parameter allows the speed to a *SRLOAD or *SRSAVE
  213. operation to be increased.  As sideways RAM occupies the same address space
  214. as the currently selected filing system, loading and saving to and from
  215. sideways RAM is noticeably slower than the same operation performed with
  216. normal RAM.  To speed up the operation, the use of the Q parameter will
  217. designate normal RAM between OSHWM and the bottom of screen memory as a
  218. buffer.  This dramatically increases the size of the buffer available for
  219. transfers between sideways RAM and the currently selected filing system,
  220. thereby speeding up the load or save operation.
  221.  
  222. It must be born in mind that, although the greater speed is desirable, the
  223. use of the Q parameter is not always a good idea.  Data resident in this
  224. area of normal RAM (this includes BAS128 when loaded) will be overwritten
  225. when a 'Quick' load or save command is performed.
  226.  
  227.  
  228. THE SIDEWAYS RAM UTILITIES
  229.  
  230. *SRSAVE <FILENAME> <START ADDRESS> <END ADDRESS> (<ROM ID>) (Q)
  231.         This command performs the same function as the *SAVE command (see
  232. the Disc Filing System User Guide) except that the area of memory to be
  233. saved to the filing system is resident in the sideways RAM.
  234.  
  235. As with the *SAVE command the end address may be substituted with the length
  236. of the block of memory concerned.  If this is used the syntax becomes:
  237. *SRSAVE <FILENAME> (<START ADDRESS>+<LENGTH>) (<ROM ID>) (Q)
  238.  
  239. *SRLOAD <FILENAME> <LOAD ADDRESS> (<ROM ID>) (Q)
  240.         This command functions is the same way as the *LOAD command (see
  241. the Disc Filing System User Guide) except that the area of memory into which
  242. the specified file is read, is resident in the sideways RAM.
  243.  
  244. Note:  having loaded a ROM image into sideways RAM it is necessary to press
  245. the BREAK key.  This is because certain types of OS call directed to the
  246. specific page into which the image is being loaded, are disabled by the
  247. write operation.  These calls are not reinstated until a reset is performed. 
  248. The same applies to ROM images loaded using *SRWRITE.
  249.  
  250.  
  251.  
  252. *SRWRITE <START ADDRESS> <END ADDRESS> <START ADDRESS> (<ROM ID>)
  253.         This command writes a copy of a specified area of memory contained
  254. within normal RAM to a specified position in sideways RAM.
  255.  
  256. The first parameter is the address of the start of the block of memory in
  257. normal RAM that is to be transferred.  The second parameter is the address
  258. in normal RAM of the first free byte after the end of block that is to be
  259. transferred.
  260.  
  261. The second parameter may be replaced with the length of the block to be
  262. transferred.  If the length is substituted for the end address of the block,
  263. then the syntax of the command becomes: 
  264. *SRWRITE (<START ADDRESS>+<LENGTH>) <START ADDRESS> (<ROM ID>)
  265.  
  266. The third parameter is the address of the start of the area in the sideways
  267. RAM into which the block is to be transferred.
  268.  
  269. *SRREAD <START ADDRESS> <END ADDRESS> <START ADDRESS> (<ROM ID>)
  270.         This command performs the reverse function of the *SRWRITE command. 
  271. It reads a specified block of sideways RAM and copies it onto a given area
  272. of normal RAM>
  273.  
  274. The first two parameters point to the start and end of te block in NORMAL
  275. RAM into which the information is to be transferred.  The third parameter
  276. points to the start of ge area of SIDEWAYS RAM that is to be transferred.
  277.  
  278. It is important to realise that the first address parameters given with both
  279. *SRREAD and *SRWRITE refer to normal RAM.
  280.  
  281. *SRROM <ROM ID>
  282.         This command is used to specify the use to which a page of memory is to be
  283. put.  It reserves the page of sideways RAM specified by the ROM ID
  284. parameter, for use with the absolute addressing mode.
  285.  
  286. This is the default condition for all of the sideways RAM pages and is only
  287. reset upon power-up.
  288.  
  289. *SRDATA <ROM ID>
  290.         This command performs the same function as *SRROM except that the
  291. specified page if sideways RAM is allocated for use with data.  If this
  292. command is issued in respect of one or more pages of sideways RAM, the
  293. specified page(s) must then be addressed using the pseudo addressing method.
  294.  
  295. Important Notes:
  296. Users should note that th images of some commercially available ROMs will
  297. not function in the sideways RAM area due to protection mechanisms employed
  298. by some software houses.
  299.  
  300. The sideways RAM utilities are only resident in version 2.2 DFS and above.
  301.  
  302.  
  303. BAS128 - DISC BASED BBC BASIC
  304.  
  305. This version of BBC BASIC gives the user access to a full 64k of memory for
  306. BASIC programs.
  307.  
  308. BAS128 is loaded from the disc by typing :  *BAS128
  309.  
  310. The screen will be cleared and the banner BBC BASIC will appear together
  311. with a bytes free message 64k.
  312.  
  313. The ">" prompt will be displayed and commands can be issued in the same way
  314. as for the ROM based BASIC.
  315.  
  316. If you are a new user to the BBC Micro you may wish to read the User Guide
  317. before using this disc-based version of BBC BASIC.  If you are familiar with
  318. the use of BASIC and intend to write your own programs, you may need to be
  319. aware of the technical differences between the ROM-based BASIC and the
  320. disc-based BAS128.  They key point is that this disc-based version is loaded
  321. into the RAM area in which a user program would normally reside.  The 64k
  322. area of additional "sideways" RAM is then made available for the user
  323. program.
  324.  
  325. The detailed differences between the two BASICs are as follows:
  326.  
  327. 1.      When using BAS128, the 64k of additional memory pretends to be a
  328. continuous address space above the normal 64k address space of the computer. 
  329. Thus addresses &000000 to &00FFFF refer to normal  memory and addresses
  330. &010000 to &01FFFF refer to the 64k bytes of sideways RAM.
  331.  
  332.         PAGE defaults to &10000
  333.         HIMEM defaults to &20000
  334.  
  335.         Similarly, LOMEM and TOP are addressed in this way.
  336.  
  337. 2.      Indirection Operations.
  338.  
  339.         Statements such as      DIM code 100            will assign a 17-bit
  340. value to "code".  Indirection operators may then be used to read and write
  341. data into the area of memory reserved by the DIM statement: eg:
  342.  
  343.         !code=27127, PRINT code?3 or $(code+27)="HELLO"
  344.  
  345.         Indirection operators will address normal memory if the calculated 
  346. pointer is in the range &000000 to &00FFFF and will address sideways RAM if
  347. the pointer is in the range &010000 to &01FFFF.
  348.  
  349. 3.      The Assembler
  350.  
  351.         This will operate using 0% and P% as 17-bit pointers.
  352.  
  353.         a)  The Destination Pointer
  354.         If the destination for the code is in the range &000000 to &00FFFF,
  355. then normal memory is referenced.  Addresses from &010000 to &01FFFF refer
  356. to sideways RAM.
  357.  
  358.         b)  The Program Counter
  359.         The code produced is adjusted so that address references in the
  360. range &010000 to &01FFFF refer to sideways RAM addresses &008000 to &00BFFF. 
  361. References from one bank of sideways RAM to another are trapped giving a
  362. BANK error; eg:
  363.  
  364.         P%=&13F00:[JSR &1CF34
  365.  
  366.         will give a BANK error. 
  367.         Note that, when BAS128 is resident in user RAM, the Q parameter
  368. detailed above should NOT be used as BAS128 may be overwritten.
  369.  
  370.         When compiling, any code generated over a bank boundary is trapped,
  371. resulting in a WRAP error.  Thus, the maximum amount of code that can be
  372. generated at one time is 16kbytes; eg:
  373.  
  374.         P%=&13FFC:[LDA #0 :TAY:SEC:SBC &70
  375.  
  376.         will give a WRAP error since execution cannot pass from one bank to
  377. the next directly.
  378.  
  379. 4.      SHADOW mode will be forced on so that the BAS128 can reside in RAM
  380. between &3000 and &8000.  The remaining memory from OSHWM to &3000 may be
  381. used by BAS128 for workspace.
  382.  
  383. 5.      The LOAD, SAVE and CHAIN commands make use of the OSGBPB routine
  384. which is not available with the TAPE filing syxtem on OS 2.00.  Thus these
  385. commands will not work if the TAPE filing system is selected.  They will
  386. work with DISC, ADFS or ECONET.
  387.  
  388.  
  389. ADDITIONAL OPERATING SYSTEM COMMANDS
  390.  
  391. There are four new Operating System calls which have been provided for use
  392. with the sideways RAM.  These are as follows:
  393.  
  394. OSWORD 66  Block Transfer
  395. The parameter block:-
  396.  
  397.         XY+     0       bit 7 clear/set for READ/WRITE
  398.                         bit 6 clear/set for ABSOLUTE/PSEUDO
  399.                 1-4     Main RAM address
  400.                 5-6     Block Length
  401.                 7       ROM ID  0-&13 0-F, W, X, Y, Z, (ABSOLUTE only)
  402.                 8-9     SRAM address
  403.  
  404.  
  405. OSWORD 67  Load  Save
  406. The parameter block:-
  407.  
  408.         XY+     0       bit 7 clear/set for SAVE/LOAD
  409.                         bit 6 clear/set for ABSOLUTE/CONTIGUOUS
  410.                 1-2     File Name address
  411.                 3       ROM ID  0-&13   0-F, W, X, Y, Z (ABSOLUTE only)
  412.                 4-5     File length  (SA+E only)
  413.                 6-7     Buffer Start address
  414.                 8-9     Buffer length, 0 for default,
  415.                            >=32K for buffer from OSHWM to bottom of screen memory
  416.  
  417.  
  418.  
  419.  
  420.  
  421.  
  422. OSBYTE 68   Test RAM Presence
  423. Returns a byte in X
  424.  
  425.         7                    0
  426.         * - F E 1 0 D C RAM Present flags
  427.  
  428. * - bit 7 set if E/F are being used for 3rd and 4th pages.
  429. Bits 0-5 set if RAM pages found in given slot (see above), on last
  430. BREAK/POWER ON.
  431.  
  432.  
  433. OSBYTE 69  Test Pseudo/Absolute Use of Page
  434. Returns a byte in X.
  435.  
  436. Bit 7  as for OSBYTE 68,
  437. Bits 0-5 set if RAM in given slot (see above) is being used in PSEUDO
  438. addressing mode.  
  439.